/**
 * 功能描述
 */

define(function (require, exports, module) {
	var Dialog=require("dialog");
	var aw = require("ajaxwrapper");
	var QuestionnaireProfile_Events=require("../handler/QuestionnaireProfile_Events");
	
    module.exports = {
		save:function(widget){
			var pkTravelContract = widget.get("form").getValue("pkTravelContract");
			var data2;
			if(QuestionnaireProfile_Events.save(widget).length != 0){
				data2=aw.customParam(QuestionnaireProfile_Events.save(widget));
				aw.saveOrUpdate("api/customervisitrecord/savecontract",data2+"&pkTravelContract="+pkTravelContract,function(data){
					widget.show([".J-grid"]).hide([".J-tab"]);
					widget.get("subnav").show(["checkInDate","status","search"]).hide(["return","save"]);							
					widget.get("grid").refresh();
					Dialog.tip(data.msg);
				});
			}
		}
    };
});
